home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / FileTransfers.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  10.2 KB  |  409 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        FileTransfers.a
  3. ;
  4. ;    Contains:    CommToolbox File Transfer Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1988-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__FILETRANSFERS__') = 'UNDEFINED' THEN
  18. __FILETRANSFERS__ SET 1
  19.  
  20.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  21.     include 'ConditionalMacros.a'
  22.     ENDIF
  23.     IF &TYPE('__STANDARDFILE__') = 'UNDEFINED' THEN
  24.     include 'StandardFile.a'
  25.     ENDIF
  26.     IF &TYPE('__CTBUTILITIES__') = 'UNDEFINED' THEN
  27.     include 'CTBUtilities.a'
  28.     ENDIF
  29.     IF &TYPE('__CONNECTIONS__') = 'UNDEFINED' THEN
  30.     include 'Connections.a'
  31.     ENDIF
  32.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  33.     include 'Files.a'
  34.     ENDIF
  35.     IF &TYPE('__TERMINALS__') = 'UNDEFINED' THEN
  36.     include 'Terminals.a'
  37.     ENDIF
  38.  
  39.  
  40. curFTVersion                    EQU        2                    ; current file transfer manager version
  41.  
  42.                                                             ; FTErr    
  43. ftGenericError                    EQU        -1
  44. ftNoErr                            EQU        0
  45. ftRejected                        EQU        1
  46. ftFailed                        EQU        2
  47. ftTimeOut                        EQU        3
  48. ftTooManyRetry                    EQU        4
  49. ftNotEnoughDSpace                EQU        5
  50. ftRemoteCancel                    EQU        6
  51. ftWrongFormat                    EQU        7
  52. ftNoTools                        EQU        8
  53. ftUserCancel                    EQU        9
  54. ftNotSupported                    EQU        10
  55. ; typedef OSErr                         FTErr
  56.  
  57.  
  58. ftIsFTMode                        EQU        $01
  59. ftNoMenus                        EQU        $02
  60. ftQuiet                            EQU        $04
  61. ftConfigChanged                    EQU        $10
  62. ftSucc                            EQU        $80
  63. ; typedef unsigned long                 FTFlags
  64.  
  65.  
  66. ftSameCircuit                    EQU        $01
  67. ftSendDisable                    EQU        $02
  68. ftReceiveDisable                EQU        $04
  69. ftTextOnly                        EQU        $08
  70. ftNoStdFile                        EQU        $10
  71. ftMultipleFileSend                EQU        $20
  72. ; typedef unsigned short                 FTAttributes
  73.  
  74.  
  75. ftReceiving                        EQU        0
  76. ftTransmitting                    EQU        1
  77. ftFullDuplex                    EQU        2                    ; (16) added ftFullDuplex bit.
  78. ; typedef unsigned short                 FTDirection
  79.  
  80. ;     application routines type definitions 
  81.  
  82.  
  83. ; typedef FTRecord *                    FTPtr
  84.  
  85. ; typedef FTPtr *                        FTHandle
  86.  
  87. FTRecord                RECORD 0
  88. procID                     ds.w    1                ; offset: $0 (0)
  89. flags                     ds.l    1                ; offset: $2 (2)
  90. errCode                     ds.w    1                ; offset: $6 (6)
  91. refCon                     ds.l    1                ; offset: $8 (8)
  92. userData                 ds.l    1                ; offset: $C (12)
  93. defProc                     ds.l    1                ; offset: $10 (16)
  94. config                     ds.l    1                ; offset: $14 (20)
  95. oldConfig                 ds.l    1                ; offset: $18 (24)
  96. environsProc             ds.l    1                ; offset: $1C (28)
  97. reserved1                 ds.l    1                ; offset: $20 (32)
  98. reserved2                 ds.l    1                ; offset: $24 (36)
  99. ftPrivate                 ds.l    1                ; offset: $28 (40)
  100. sendProc                 ds.l    1                ; offset: $2C (44)
  101. recvProc                 ds.l    1                ; offset: $30 (48)
  102. writeProc                 ds.l    1                ; offset: $34 (52)
  103. readProc                 ds.l    1                ; offset: $38 (56)
  104. owner                     ds.l    1                ; offset: $3C (60)
  105. direction                 ds.w    1                ; offset: $40 (64)
  106. theReply                 ds        SFReply            ; offset: $42 (66)
  107. writePtr                 ds.l    1                ; offset: $8C (140)
  108. readPtr                     ds.l    1                ; offset: $90 (144)
  109. theBuf                     ds.l    1                ; offset: $94 (148)
  110. bufSize                     ds.l    1                ; offset: $98 (152)
  111. autoRec                     ds        Str255            ; offset: $9C (156)
  112. attributes                 ds.w    1                ; offset: $19C (412)
  113. sizeof                     EQU *                    ; size:   $19E (414)
  114.                         ENDR
  115. ; typedef unsigned short                 FTCompletionKind
  116.  
  117.  
  118.                                                             ; FTReadProc messages 
  119. ftReadOpenFile                    EQU        0                    ; count = forkFlags, buffer = pblock from PBGetFInfo 
  120. ftReadDataFork                    EQU        1
  121. ftReadRsrcFork                    EQU        2
  122. ftReadAbort                        EQU        3
  123. ftReadComplete                    EQU        4
  124. ftReadSetFPos                    EQU        6                    ; count = forkFlags, buffer = pBlock same as PBSetFPos 
  125. ftReadGetFPos                    EQU        7                    ; count = forkFlags, buffer = pBlock same as PBGetFPos 
  126.  
  127.                                                             ; FTWriteProc messages 
  128. ftWriteOpenFile                    EQU        0                    ; count = forkFlags, buffer = pblock from PBGetFInfo 
  129. ftWriteDataFork                    EQU        1
  130. ftWriteRsrcFork                    EQU        2
  131. ftWriteAbort                    EQU        3
  132. ftWriteComplete                    EQU        4
  133. ftWriteFileInfo                    EQU        5
  134. ftWriteSetFPos                    EQU        6                    ; count = forkFlags, buffer = pBlock same as PBSetFPos 
  135. ftWriteGetFPos                    EQU        7                    ; count = forkFlags, buffer = pBlock same as PBGetFPos 
  136.  
  137.                                                             ;    fork flags 
  138. ftOpenDataFork                    EQU        1
  139. ftOpenRsrcFork                    EQU        2
  140.  
  141. ;
  142. ; pascal FTErr InitFT(void )
  143. ;
  144.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  145.         IMPORT_CFM_FUNCTION InitFT
  146.     ENDIF
  147.  
  148. ;
  149. ; pascal Handle FTGetVersion(FTHandle hFT)
  150. ;
  151.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  152.         IMPORT_CFM_FUNCTION FTGetVersion
  153.     ENDIF
  154.  
  155. ;
  156. ; pascal short FTGetFTVersion(void )
  157. ;
  158.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  159.         IMPORT_CFM_FUNCTION FTGetFTVersion
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal FTHandle FTNew(short procID, FTFlags flags, FileTransferSendUPP sendProc, FileTransferReceiveUPP recvProc, FileTransferReadUPP readProc, FileTransferWriteUPP writeProc, FileTransferEnvironsUPP environsProc, WindowPtr owner, long refCon, long userData)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  166.         IMPORT_CFM_FUNCTION FTNew
  167.     ENDIF
  168.  
  169. ;
  170. ; pascal void FTDispose(FTHandle hFT)
  171. ;
  172.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  173.         IMPORT_CFM_FUNCTION FTDispose
  174.     ENDIF
  175.  
  176. ;
  177. ; pascal FTErr FTStart(FTHandle hFT, FTDirection direction, const SFReply *fileInfo)
  178. ;
  179.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  180.         IMPORT_CFM_FUNCTION FTStart
  181.     ENDIF
  182.  
  183. ;
  184. ; pascal FTErr FTAbort(FTHandle hFT)
  185. ;
  186.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  187.         IMPORT_CFM_FUNCTION FTAbort
  188.     ENDIF
  189.  
  190. ;
  191. ; pascal FTErr FTSend(FTHandle hFT, short numFiles, FSSpecArrayPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  192. ;
  193.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  194.         IMPORT_CFM_FUNCTION FTSend
  195.     ENDIF
  196.  
  197. ;
  198. ; pascal FTErr FTReceive(FTHandle hFT, FSSpecPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  199. ;
  200.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  201.         IMPORT_CFM_FUNCTION FTReceive
  202.     ENDIF
  203.  
  204. ;
  205. ; pascal void FTExec(FTHandle hFT)
  206. ;
  207.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  208.         IMPORT_CFM_FUNCTION FTExec
  209.     ENDIF
  210.  
  211. ;
  212. ; pascal void FTActivate(FTHandle hFT, Boolean activate)
  213. ;
  214.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  215.         IMPORT_CFM_FUNCTION FTActivate
  216.     ENDIF
  217.  
  218. ;
  219. ; pascal void FTResume(FTHandle hFT, Boolean resume)
  220. ;
  221.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  222.         IMPORT_CFM_FUNCTION FTResume
  223.     ENDIF
  224.  
  225. ;
  226. ; pascal Boolean FTMenu(FTHandle hFT, short menuID, short item)
  227. ;
  228.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  229.         IMPORT_CFM_FUNCTION FTMenu
  230.     ENDIF
  231.  
  232. ;
  233. ; pascal short FTChoose(FTHandle *hFT, Point where, FileTransferChooseIdleUPP idleProc)
  234. ;
  235.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  236.         IMPORT_CFM_FUNCTION FTChoose
  237.     ENDIF
  238.  
  239. ;
  240. ; pascal void FTEvent(FTHandle hFT, const EventRecord *theEvent)
  241. ;
  242.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  243.         IMPORT_CFM_FUNCTION FTEvent
  244.     ENDIF
  245.  
  246. ;
  247. ; pascal Boolean FTValidate(FTHandle hFT)
  248. ;
  249.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  250.         IMPORT_CFM_FUNCTION FTValidate
  251.     ENDIF
  252.  
  253. ;
  254. ; pascal void FTDefault(Ptr *theConfig, short procID, Boolean allocate)
  255. ;
  256.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  257.         IMPORT_CFM_FUNCTION FTDefault
  258.     ENDIF
  259.  
  260. ;
  261. ; pascal Handle FTSetupPreflight(short procID, long *magicCookie)
  262. ;
  263.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  264.         IMPORT_CFM_FUNCTION FTSetupPreflight
  265.     ENDIF
  266.  
  267. ;
  268. ; pascal void FTSetupSetup(short procID, const void *theConfig, short count, DialogPtr theDialog, long *magicCookie)
  269. ;
  270.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  271.         IMPORT_CFM_FUNCTION FTSetupSetup
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal Boolean FTSetupFilter(short procID, const void *theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie)
  276. ;
  277.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  278.         IMPORT_CFM_FUNCTION FTSetupFilter
  279.     ENDIF
  280.  
  281. ;
  282. ; pascal void FTSetupItem(short procID, const void *theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie)
  283. ;
  284.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  285.         IMPORT_CFM_FUNCTION FTSetupItem
  286.     ENDIF
  287.  
  288. ;
  289. ; pascal void FTSetupXCleanup(short procID, const void *theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie)
  290. ;
  291.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  292.         IMPORT_CFM_FUNCTION FTSetupXCleanup
  293.     ENDIF
  294.  
  295. ;
  296. ; pascal void FTSetupPostflight(short procID)
  297. ;
  298.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  299.         IMPORT_CFM_FUNCTION FTSetupPostflight
  300.     ENDIF
  301.  
  302. ;
  303. ; pascal Ptr FTGetConfig(FTHandle hFT)
  304. ;
  305.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  306.         IMPORT_CFM_FUNCTION FTGetConfig
  307.     ENDIF
  308.  
  309. ;
  310. ; pascal short FTSetConfig(FTHandle hFT, const void *thePtr)
  311. ;
  312.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  313.         IMPORT_CFM_FUNCTION FTSetConfig
  314.     ENDIF
  315.  
  316. ;
  317. ; pascal FTErr FTIntlToEnglish(FTHandle hFT, const void *inputPtr, Ptr *outputPtr, short language)
  318. ;
  319.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  320.         IMPORT_CFM_FUNCTION FTIntlToEnglish
  321.     ENDIF
  322.  
  323. ;  (16) chenged OSErr to FTErr
  324. ;
  325. ; pascal FTErr FTEnglishToIntl(FTHandle hFT, const void *inputPtr, Ptr *outputPtr, short language)
  326. ;
  327.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  328.         IMPORT_CFM_FUNCTION FTEnglishToIntl
  329.     ENDIF
  330.  
  331. ;  (16) chenged OSErr to FTErr
  332. ;
  333. ; pascal void FTGetToolName(short procID, Str255 name)
  334. ;
  335.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  336.         IMPORT_CFM_FUNCTION FTGetToolName
  337.     ENDIF
  338.  
  339. ;
  340. ; pascal short FTGetProcID(ConstStr255Param name)
  341. ;
  342.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  343.         IMPORT_CFM_FUNCTION FTGetProcID
  344.     ENDIF
  345.  
  346. ;
  347. ; pascal void FTSetRefCon(FTHandle hFT, long refCon)
  348. ;
  349.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  350.         IMPORT_CFM_FUNCTION FTSetRefCon
  351.     ENDIF
  352.  
  353. ;
  354. ; pascal long FTGetRefCon(FTHandle hFT)
  355. ;
  356.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  357.         IMPORT_CFM_FUNCTION FTGetRefCon
  358.     ENDIF
  359.  
  360. ;
  361. ; pascal void FTSetUserData(FTHandle hFT, long userData)
  362. ;
  363.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  364.         IMPORT_CFM_FUNCTION FTSetUserData
  365.     ENDIF
  366.  
  367. ;
  368. ; pascal long FTGetUserData(FTHandle hFT)
  369. ;
  370.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  371.         IMPORT_CFM_FUNCTION FTGetUserData
  372.     ENDIF
  373.  
  374. ;
  375. ; pascal void FTGetErrorString(FTHandle hFT, short id, Str255 errMsg)
  376. ;
  377.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  378.         IMPORT_CFM_FUNCTION FTGetErrorString
  379.     ENDIF
  380.  
  381. ;    These Async routines were added to InterfaceLib in System 7.5
  382. ;
  383.  
  384. ;
  385. ; pascal FTErr FTSendAsync(FTHandle hFT, short numFiles, FSSpecArrayPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  386. ;
  387.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  388.         IMPORT_CFM_FUNCTION FTSendAsync
  389.     ENDIF
  390.  
  391. ;
  392. ; pascal FTErr FTReceiveAsync(FTHandle hFT, FSSpecPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  393. ;
  394.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  395.         IMPORT_CFM_FUNCTION FTReceiveAsync
  396.     ENDIF
  397.  
  398. ;
  399. ; pascal FTErr FTCompletionAsync(FTHandle hFT, FTCompletionKind completionCall)
  400. ;
  401.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  402.         IMPORT_CFM_FUNCTION FTCompletionAsync
  403.     ENDIF
  404.  
  405.  
  406.     ENDIF ; __FILETRANSFERS__ 
  407.  
  408.